
public class DormatoryTestApp {

	public static void main(String args[]) {
		Person bob = new Person("Bob Stevens");
		Person mary = new Person("Mary Johnson");
		Person larry = new Person("Larry Jones");
		Person steve = new Person("Steveie Wonder");
		Person luke = new Person("Luke Skywalker");
		Person darth = new Person("Darth Vadar");
		
		Dormitory dorm1 = new Dormitory("Dorm 1", 5);
		dorm1.addPerson(bob);
		dorm1.addPerson(mary);
		dorm1.addPerson(larry);
		System.out.println("Added 3 people, percentAvailable=" + dorm1.percentAvailable());
		
		dorm1.addPerson(steve);
		dorm1.addPerson(luke);
		System.out.println("Added 5 people, percentAvailable=" + dorm1.percentAvailable());
		
		try {
			dorm1.addPerson(luke);
			System.out.println("Added 6 people"); // this will never get executed
		} catch (RuntimeException e) {
			System.out.println("Tried to add 6th person, got RuntimeException=" + e);
		}
	}
}
